﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SnakeGame
{
    public class Wall
    {
        private MatrixCoordinate[] body;
        private MatrixCoordinate topLeft;
        
        public Wall(int topLeftX, int topLeftY, int length, bool isHorizontal)
        {
            this.body = new MatrixCoordinate[length];

            if (isHorizontal)
            {
                for (int i = 0; i < length; i++)
                {
                    this.body[i] = new MatrixCoordinate(topLeftX + i, topLeftY);
                }
            }
            else // it is Vertical.
            {
                for (int i = 0; i < length; i++)
                {
                    this.body[i] = new MatrixCoordinate(topLeftX, topLeftY + i);
                }
            }

            this.TopLeft = this.body[0];
        }

        public MatrixCoordinate[] Body
        {
            get
            {
                return this.body;
            }
        }

        public MatrixCoordinate TopLeft
        {
            get
            {
                return this.topLeft;
            }

            private set
            {
                this.topLeft = value;
            }
        }
    }
}
